<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta content="phalconplus API doc" name="description">
    <title>
                    phalconplus API Documentation
            </title>
    <link rel="stylesheet" type="text/css" href="../../../asset/static/prettify.css" />

<script src="../../../asset/static/prettify.js"></script>
<script src="../../../asset/api_definition.js"></script>


                        <link rel="stylesheet" type="text/css" href="../../../asset/static/prettify.css" />
                    <link rel="stylesheet" type="text/css" href="../../../asset/static/zephir-theme.css" />
            
    

                        <script src="../../../asset/static/prettify.js"></script>
                                    <script src="../../../asset/api_definition.js"></script>
                    <script src="../../../asset/static/jquery.min.js"></script>
                    <script src="../../../asset/static/zephir-doc.js"></script>
                <script type="application/javascript">let ZepCurrentPath = '../../../'</script>
    </head>
 <body onload="prettyPrint()">
        <div id="top-bar">
            <div id="top-left">
                                    phalconplus Documentation <span class="version">v1.2.0</span>
                            </div>
            <div id="top-right">
            </div>
        </div>
        <div id="body">
            <div id="body-left">
                <div class="header-search">
                    <input class="search-box" placeholder="Search for a class or namespace " type="text" />
                    <div id="menu-wrapper">
                    </div>
                </div>
            </div>
            <div id="body-right">
                <div class="content">
                    
<div class="breadcrumb">
    
    <ul>
        
        <li><a href="../../../index.html">Home</a></li>
        
                <li><a href="../../../classes.html">Classes</a></li>
                <li><a href="../../../class/PhalconPlus/Base/SimpleRequest.html">PhalconPlus\Base\SimpleRequest</a></li>
                <li><a >Source</a></li>
                
    </ul>
    
</div>
<div class="class-header source clearfix">
    
    <div class="access-buttons">
        <a class="zep-button" href="../../../class/PhalconPlus/Base/SimpleRequest.html">Class</a>

            </div>
    
    <div class="class-full-name">
        <span class="class-type">Class</span>
        
                <span class="namespace-piece">
            <a href="../../../namespace/PhalconPlus.html">PhalconPlus</a>
        </span>
                <span class="namespace-piece">
            <a href="../../../namespace/PhalconPlus/Base.html">Base</a>
        </span>
        
        <h1 class="class-name">SimpleRequest</h1>
    </div>
    
</div>

<pre class="zephir-source-file prettyprint linenums">
    namespace PhalconPlus\Base;
use PhalconPlus\Base\ProtoBuffer;

final class SimpleRequest extends AbstractRequest
{
    /**
     * @var array
     */
    private params = [];

    public function softClone(array data, boolean deep = false) -> <ProtoBuffer>
    {
        var key, val;
        for key, val in data {
            this->__set(key, val);
        }
        return this;
    }

    protected function getSelfVars() -> array
    {
        return this->params;
    }

    public function getParam(var idx, var defaultValue = null)
    {
        var val;
        if fetch val, this->params[idx] {
            return val;
        }
        return defaultValue;
    }

    public function hasParam(var idx)
    {
        if isset this->params[idx] {
            return true;
        } else {
            return false;
        }
    }

    public function setParams(array params) -> <SimpleRequest>
    {
        let this->params = params;
        return this;
    }

    public function setParam(var val, var key = null) -> <SimpleRequest>
    {
        if !is_null(key) {
            let this->params[key] = val;
        } else {
            array_push(this->params, val);
        }
        return this;
    }

    public function getParams() -> array
    {
        return this->params;
    }

    public function __set(string! key, val)
    {
        let this->params[key] = val;
    }

    public function __isset(string! key)
    {
        if isset this->params[key] {
            return true;
        }
        return false;
    }

    public function __get(string! key)
    {
        if isset this->params[key] {
            return this->params[key];
        }
        return null;
    }

    public function __unset(string! key) -> void
    {
        if isset this->params[key] {
            unset(this->params[key]);
        }
    }

    public function isEmpty() -> boolean
    {
        return empty(this->params);
    }
}
</pre>
                </div>
            </div>
        </div>
    </body>
</html>
